/**
 * 
 */
package com.template;

import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Connection;
/**   
*    
* 项目名称：point   
* 类名称：DBUtils   
* 类描述：   
* 创建人：henry   
* 创建时间：Jul 4, 2019 11:26:38 AM   
* @version        
*/
public class DBUtils 
{
private static final String URL = "jdbc:mysql://192.168.1.18:3306/point";
private static final String UNAME = "root";
private static final String PWD = "123456";

private static Connection conn = null;

		static
		{
		try
		{
		  // 1.加载驱动程序
		      Class.forName("com.mysql.jdbc.Driver");
		     // 2.获得数据库的连接
		    conn = DriverManager.getConnection(URL, UNAME, PWD);
		  }
		  catch (ClassNotFoundException e)
		  {
		      e.printStackTrace();
		   }
		    catch (SQLException e)
		    {
		       e.printStackTrace();
		   }
		  }
		
		 public static Connection getConnection()
		 {
		    return conn;
		   }
 }
